
# $Id: Point.pm 140 2013-04-11 02:35:23Z chengxin.cai $

use strict;

package Shape;

use Switch;
use Carp;
use PerlUtil qw( gen_getter gen_setter );

sub import {
    my $package = shift;
    $package =~ s/.*:://;

    ##export the constructor
    no strict 'refs';
    my ($caller) = caller;
    *{ $caller . '::' . $package } = \&{$package};

}

sub Shape {

    bless sub {
        my $op = shift;
        carp 'Invalid operation ' . $op; 
    }, __PACKAGE__;
}

use overload q{""} =>sub {
        my $self = shift;

        sprintf "#<%s%s>",
            ref $self;
};

sub draw {
    carp 'Undefined draw';
}

sub area {
    0;
}

1;

